package com.example.wenzimanxian;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Strat20Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_strat20);
        Button astrat9=findViewById(R.id.A9_strat);
        astrat9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SharedPreferences sp=getSharedPreferences("youxi",MODE_PRIVATE);
                String c=sp.getString("name","");
                String c1=sp.getString("name1","");
                String c2=sp.getString("name2","");
                if(c.equals("qq")&&c1.equals("yy")&&c2.equals("aa")){
                    Intent intent=new Intent(Strat20Activity.this,Strat21Activity.class);
                    startActivity(intent);
                }else if((c.equals("zz")&&c1.equals("yy"))||(c.equals("qq")&&c1.equals("yy")&&c2.equals("bb"))){
                    Intent intent=new Intent(Strat20Activity.this,Strat22Activity.class);
                    startActivity(intent);
                }else if(c.equals("qq")&&c1.equals("cc")&&c2.equals("aa")){
                    Intent intent=new Intent(Strat20Activity.this,Strat23Activity.class);
                    startActivity(intent);
                }else if((c.equals("zz")&&c1.equals("cc"))||(c.equals("qq")&&c1.equals("cc")&&c2.equals("bb"))){
                    Intent intent=new Intent(Strat20Activity.this,Strat24Activity.class);
                    startActivity(intent);
                }

            }
        });
        Button bstrat9=findViewById(R.id.B9_strat);
        bstrat9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SharedPreferences sp=getSharedPreferences("youxi",MODE_PRIVATE);
                String c=sp.getString("name","");
                String c1=sp.getString("name1","");
                String c2=sp.getString("name2","");
                if(c.equals("qq")&&c1.equals("yy")&&c2.equals("aa")){
                    Intent intent=new Intent(Strat20Activity.this,Strat21Activity.class);
                    startActivity(intent);
                }else if((c.equals("zz")&&c1.equals("yy"))||(c.equals("qq")&&c1.equals("yy")&&c2.equals("bb"))){
                    Intent intent=new Intent(Strat20Activity.this,Strat22Activity.class);
                    startActivity(intent);
                }else if(c.equals("qq")&&c1.equals("cc")&&c2.equals("aa")){
                    Intent intent=new Intent(Strat20Activity.this,Strat23Activity.class);
                    startActivity(intent);
                }else if((c.equals("zz")&&c1.equals("cc"))||(c.equals("qq")&&c1.equals("cc")&&c2.equals("bb"))){
                    Intent intent=new Intent(Strat20Activity.this,Strat24Activity.class);
                    startActivity(intent);
                }
            }
        });
    }
}
